Q: I'm debugging with GDB. If I know the address of a symbol, how can I find the shared library that contains it?A: Starting with the GDB that ships with Xcode 1.5 (Apple version gdb-330.1), you can do this by passing the address to Listing 1: Finding a symbol's shared library $ gdb GNU gdb 5.3-20030128 (Apple version gdb-330.1) [Ö] 0x900074c8 in mach_msg_trap () (gdb) p/a &RunCurrentEventLoopInMode $1 = 0x927d5edc <RunCurrentEventLoopInMode> (gdb) info sharedlibrary 0x927d5edc 9 HIToolbox F 0x927d0000 dyld Y Y \ /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/\ HIToolbox.framework/Versions/A/HIToolbox at 0x927d0000 (offset 0x0) In earlier versions of GDB you could do the same thing by using Document Revision History
Posted: 2004-11-02 |